# Base of your container
FROM registry.alauda.cn/longhronshen/aspnetvnext-rc1-nodejs-6

#RUN npm config set registry https://registry.npm.taobao.org
#RUN ["npm", "install", "-g", "bower", "gulp", "gulp-shell", "gulp-jasmine"]

# Copy the project into folder and then restore packages
COPY . /app
WORKDIR /app
RUN ["dnu", "restore", "--runtime", "mono", "--ignore-failed-sources"]

#WORKDIR /app/test/Sino.CapacityCloud.Tests
#RUN ["dnx", "test"]

WORKDIR /app/src/Sino.CapacityCloud.Web

#RUN ["npm", "install", "bower", "gulp", "gulp-shell", "gulp-jasmine"]

#RUN ["npm", "install"]
#RUN ["bower", "install", "--allow-root"]

#RUN ["gulp", "test"]

RUN echo "127.0.0.1 postgres\n127.0.0.1 ccp-redis" > /etc/hosts

# Open this port in the container
EXPOSE 5000

ENV ASPNET_ENV=Development

# Start application
#RUN ["dnx", "ef", "migrations", "add", "init", "-p", "Sino.CapacityCloud.Repositories", "-v"]
RUN ["dnx", "ef", "database", "update", "-v"]
ENTRYPOINT ["dnx", "-p", "project.json", "web", "--server.urls", "http://0.0.0.0:5000"]